//
//  MeViewController.m
//  项目A_百思不得姐
//
//  Created by wudongyang on 16/5/16.
//  Copyright © 2016年 wudongyang. All rights reserved.
//

#import "MeViewController.h"
#import "MeTableViewCell.h"
#import <AFNetworking.h>
#import "squareModel.h"
#import "LandingViewController.h"
#import "SZViewController.h"
#import "RedPeopleViewController.h"
#import "TakeViewController.h"
#import "CollectionViewController.h"
#import "UIImageView+WebCache.h"
#import "TNViewController.h"
#import "BeautyGirlViewController.h"
#import "TrafficViewController.h"
#import "YJFKViewController.h"
static NSString *const indexID = @"reuse";
@interface MeViewController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic, strong)UITableView *myTableView;
@property(nonatomic, strong)NSMutableArray *allArray;
@end

@implementation MeViewController
-(void)viewWillAppear:(BOOL)animated{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *isLogin = [defaults objectForKey:@"isLogin"];
    DSLog(@"%@",isLogin);
    if ([isLogin isEqualToString:@"1"]) {
        [self DSBJ1];
        
    }else {
        [self DSBJ0];
    }


}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    // 设置导航栏内容
    // 给导航栏标题添加文字(我的)
    self.navigationItem.title = @"我的";
    
    // 夜间按钮(点击进入夜间模式)
//    UIBarButtonItem *NightItem = [UIBarButtonItem itemWithImage:@"mine-moon-icon" highImage:@"" target:self action:@selector(NightButtonAction:)];
    UIBarButtonItem *NightItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"mine-moon-icon"] imageWithRenderingMode:1] style:UIBarButtonItemStylePlain target:self action:@selector(NightButtonAction:)];
    
    
    
    // 设置按钮(点击进入设置页)
    UIBarButtonItem *GearItem = [UIBarButtonItem itemWithImage:@"mine-setting-icon" highImage:@"mine-setting-icon-click" target:self action:@selector(GearButtonAction:)];
    
    // 我的积分按钮(点击进入积分)
    UIBarButtonItem *integralItem = [UIBarButtonItem itemWithImage:@"nav_coin_icon" highImage:@"nav_coin_icon_click" target:self action:@selector(integralAction:)];
    
    // 将两个按钮加入到导航栏右按钮)(设置,月亮[转化成BarButtonItem])
    self.navigationItem.rightBarButtonItems = @[GearItem, NightItem];
    self.navigationItem.leftBarButtonItem = integralItem;
    
    // 设置背景色
    self.view.backgroundColor = DSRGBA(223, 223, 223, 1);
    
    self.myTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.myTableView.dk_backgroundColorPicker = DKColorPickerWithRGB(0xE8E8E8,0x343434);
    [self.view addSubview:self.myTableView];
    self.myTableView.delegate = self;
    self.myTableView.dataSource = self;
    [self.myTableView registerClass:[MeTableViewCell class] forCellReuseIdentifier:indexID];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    self.myTableView.rowHeight = 308;
    MeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indexID];
    // 收藏按钮回调方法
    cell.CollectBlock = ^(void) {
        CollectionViewController *CollectVC = [[CollectionViewController alloc] init];
        [self.navigationController pushViewController:CollectVC animated:YES];
    };
    // 途牛按钮回调方法
    cell.TNBlock = ^(void){
        TNViewController *TNVC = [[TNViewController alloc] init];
        [self.navigationController pushViewController:TNVC animated:YES];
    
    
    };
    // 流量充值按钮回调方法
    cell.TrafficBlock = ^(void){
        TrafficViewController *traffVC = [[TrafficViewController alloc] init];
        [self.navigationController pushViewController:traffVC animated:YES];
    
    };
    // 美女写真按钮回调方法
    cell.GirlBlock = ^(void){
        BeautyGirlViewController *traffVC = [[BeautyGirlViewController alloc] init];
        [self.navigationController pushViewController:traffVC animated:YES];
    
    };
    // 意见反馈
    cell.YJBlock = ^(void){
        YJFKViewController *YJVC = [[YJFKViewController alloc] init];
        [self.navigationController pushViewController:YJVC animated:YES];
    
    };


    cell.selectionStyle = 0;
    
    return cell;
    
}


// 登陆状态下的页面
-(void)DSBJ1{
    self.bigView = [[UIView alloc] init];
    self.bigView.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.bigView.frame = CGRectMake(0, 0, self.view.frame.size.width, 270);
    [self.view addSubview:self.bigView];
    
    self.ViewOne = [[BaseUIView alloc] init];
//    self.ViewOne.backgroundColor = DSRGBA(233, 233, 233, 1);
    self.ViewOne.frame = CGRectMake(0, 0, self.view.frame.size.width, 10);
    [self.bigView addSubview:self.ViewOne];
    
    self.ViewTwo = [[UIView alloc] init];
    self.ViewTwo.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewTwo.frame = CGRectMake(0, 10, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewTwo];
    // 用户按钮 上面有用户头像 用户名字
    self.UserButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.UserButton.backgroundColor = [UIColor clearColor];
    self.UserButton.frame = CGRectMake(0, 11, self.view.frame.size.width, 90);
    [self.bigView addSubview:self.UserButton];
    [self.UserButton addTarget:self action:@selector(UserButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *youImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"you"]];
    youImageV.frame = CGRectMake(380, 40, 20, 20);
    [self.UserButton addSubview:youImageV];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSString *user = [defaults objectForKey:@"userName"];
    NSString *headUrl = [defaults objectForKey:@"headerUrl"];
    self.UserImageV = [[UIImageView alloc] init];
    self.UserImageV.backgroundColor = [UIColor yellowColor];
    //添加图片
    [self.UserImageV sd_setImageWithURL:[NSURL URLWithString:headUrl] placeholderImage:[UIImage imageNamed:@"tupian1.jpeg"]];
    self.UserImageV.frame = CGRectMake(10, 10, 70, 70);
    self.UserImageV.layer.masksToBounds = YES;
    self.UserImageV.layer.cornerRadius = 35;
    [self.UserButton addSubview:self.UserImageV];
    
    self.UserLabel = [[UILabel alloc] init];
    self.UserLabel.backgroundColor = [UIColor clearColor];
    
    self.UserLabel.text = user;
    self.UserLabel.frame = CGRectMake(100, 30, 150, 30);
    [self.UserButton addSubview:self.UserLabel];
    
    self.ViewThree = [[UIView alloc] init];
    self.ViewThree.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewThree.frame = CGRectMake(0, 101, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewThree];
    // 帖子按钮  上面有可以变的self.labelOne.text
    self.ButtonOne = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.ButtonOne.backgroundColor = [UIColor clearColor];
    self.ButtonOne.frame = CGRectMake(0, 102, self.view.frame.size.width / 4, 40);
    [self.bigView addSubview:self.ButtonOne];
    [self.ButtonOne addTarget:self action:@selector(TZButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.labelOne = [[UILabel alloc] init];
    self.labelOne.backgroundColor = [UIColor clearColor];
    self.labelOne.text = @"0";
    self.labelOne.textAlignment = NSTextAlignmentCenter;
    self.labelOne.frame = CGRectMake(0, 0, 102, 20);
    [self.ButtonOne addSubview:self.labelOne];
    
    self.DSLabelOne = [[UILabel alloc] init];
    self.DSLabelOne.backgroundColor = [UIColor clearColor];
    self.DSLabelOne.text = @"帖子";
    self.DSLabelOne.textAlignment = NSTextAlignmentCenter;
    self.DSLabelOne.font = [UIFont systemFontOfSize:14];
    self.DSLabelOne.textColor = [UIColor grayColor];
    self.DSLabelOne.frame = CGRectMake(0, 20, 102, 20);
    [self.ButtonOne addSubview:self.DSLabelOne];
    // 关注按钮 上面有可以变的self.labelTwo.text
    self.ButtonTwo = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.ButtonTwo.backgroundColor = [UIColor clearColor];
    self.ButtonTwo.frame = CGRectMake(self.view.frame.size.width / 4, 102, self.view.frame.size.width / 4, 40);
    [self.bigView addSubview:self.ButtonTwo];
    [self.ButtonTwo addTarget:self action:@selector(GZzButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.labelTwo = [[UILabel alloc] init];
    self.labelTwo.backgroundColor = [UIColor clearColor];
    self.labelTwo.text = @"0";
    self.labelTwo.textAlignment = NSTextAlignmentCenter;
    self.labelTwo.frame = CGRectMake(0, 0, 102, 20);
    [self.ButtonTwo addSubview:self.labelTwo];
    
    self.DSLabelTwo = [[UILabel alloc] init];
    self.DSLabelTwo.backgroundColor = [UIColor clearColor];
    self.DSLabelTwo.text = @"关注";
    self.DSLabelTwo.textAlignment = NSTextAlignmentCenter;
    self.DSLabelTwo.font = [UIFont systemFontOfSize:14];
    self.DSLabelTwo.textColor = [UIColor grayColor];
    self.DSLabelTwo.frame = CGRectMake(0, 20, 102, 20);
    [self.ButtonTwo addSubview:self.DSLabelTwo];
    // 粉丝按钮 上面有可以变得self.labelThree.text
    self.ButtonThree = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.ButtonThree.backgroundColor = [UIColor clearColor];
    self.ButtonThree.frame = CGRectMake(self.view.frame.size.width / 2, 102, self.view.frame.size.width / 4, 40);
    [self.bigView addSubview:self.ButtonThree];
    [self.ButtonThree addTarget:self action:@selector(FSButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.labelThree = [[UILabel alloc] init];
    self.labelThree.backgroundColor = [UIColor clearColor];
    self.labelThree.text = @"0";
    self.labelThree.textAlignment = NSTextAlignmentCenter;
    self.labelThree.frame = CGRectMake(0, 0, 102, 20);
    [self.ButtonThree addSubview:self.labelThree];
    
    self.DSLabelThree = [[UILabel alloc] init];
    self.DSLabelThree.backgroundColor = [UIColor clearColor];
    self.DSLabelThree.text = @"粉丝";
    self.DSLabelThree.textAlignment = NSTextAlignmentCenter;
    self.DSLabelThree.font = [UIFont systemFontOfSize:14];
    self.DSLabelThree.textColor = [UIColor grayColor];
    self.DSLabelThree.frame = CGRectMake(0, 20, 102, 20);
    [self.ButtonThree addSubview:self.DSLabelThree];
    // 消息中心按钮
    self.ButtonFour = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.ButtonFour.backgroundColor = [UIColor clearColor];
    self.ButtonFour.frame = CGRectMake(self.view.frame.size.width / 4 * 3, 102, self.view.frame.size.width / 4, 40);
    [self.bigView addSubview:self.ButtonFour];
    [self.ButtonFour addTarget:self action:@selector(XXButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.XXImageView = [[UIImageView alloc] init];
    self.XXImageView.image = [UIImage imageNamed:@"xiaoxi"];
    self.XXImageView.frame = CGRectMake(40, 0, 20, 20);
    [self.ButtonFour addSubview:self.XXImageView];
    
    self.DSLabelFour = [[UILabel alloc] init];
    self.DSLabelFour.backgroundColor = [UIColor clearColor];
    self.DSLabelFour.text = @"消息中心";
    self.DSLabelFour.textAlignment = NSTextAlignmentCenter;
    self.DSLabelFour.font = [UIFont systemFontOfSize:14];
    self.DSLabelFour.textColor = [UIColor grayColor];
    self.DSLabelFour.frame = CGRectMake(0, 20, 102, 20);
    [self.ButtonFour addSubview:self.DSLabelFour];
    
    self.ViewFour = [[UIView alloc] init];
    self.ViewFour.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewFour.frame = CGRectMake(0, 142, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewFour];
    
    self.ViewFive = [[BaseUIView alloc] init];
//    self.ViewFive.backgroundColor = DSRGBA(233, 233, 233, 1);
    self.ViewFive.frame = CGRectMake(0, 143, self.view.frame.size.width, 10);
    [self.bigView addSubview:self.ViewFive];
    
    self.ViewSix = [[BaseUIView alloc] init];
//    self.ViewSix.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewSix.frame = CGRectMake(0, 153, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewSix];
    // 我的身份
    self.myButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.myButton.backgroundColor = [UIColor whiteColor];
    self.myButton.frame = CGRectMake(0, 154, self.view.frame.size.width, 50);
    [self.bigView addSubview:self.myButton];
    [self.myButton addTarget:self action:@selector(MyButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *SFImageV = [[UIImageView alloc] init];
    SFImageV.image = [UIImage imageNamed:@"shenfen.jpg"];
    SFImageV.frame = CGRectMake(15, 15, 20, 20);
    [self.myButton addSubview:SFImageV];
    
    UILabel *SFLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 15, 100, 20)];
    SFLabel.text = @"我的身份";
    SFLabel.font = [UIFont systemFontOfSize:18];
    [self.myButton addSubview:SFLabel];
    
    UIImageView *you2ImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"you"]];
    you2ImageV.frame = CGRectMake(380, 15, 20, 20);
    [self.myButton addSubview:you2ImageV];
    
    UIImageView *ZSImageV = [[UIImageView alloc] init];
    ZSImageV.backgroundColor = DSRGBA(189, 189, 189, 1);
    ZSImageV.frame = CGRectMake(0, 204, self.view.frame.size.width, 1);
    [self.bigView addSubview:ZSImageV];
    
    self.ViewSix = [[BaseUIView alloc] initWithFrame:CGRectMake(0, 205, self.view.frame.size.width, 10)];
//    self.ViewSix.backgroundColor = DSRGBA(233, 233, 233, 1);
    [self.bigView addSubview:self.ViewSix];
    
    self.ViewSeven = [[UIView alloc] initWithFrame:CGRectMake(0, 215, self.view.frame.size.width, 1)];
    self.ViewSeven.backgroundColor = DSRGBA(189, 189, 189, 1);
    [self.bigView addSubview:self.ViewSeven];
    // 此View上面有百思红人  与 自拍两个按钮
    self.ViewEight = [[UIView alloc] initWithFrame:CGRectMake(0, 216, self.view.frame.size.width, 43)];
    self.ViewEight.backgroundColor = [UIColor lightGrayColor];
    [self.bigView addSubview:self.ViewEight];
    
    self.BSButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.BSButton.backgroundColor = [UIColor whiteColor];
    [self.BSButton setTitle:@"#百思红人#" forState:UIControlStateNormal];
    [self.BSButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.BSButton.frame = CGRectMake(0, 0, self.view.frame.size.width / 2 - 1, 43);
    [self.ViewEight addSubview:self.BSButton];
    [self.BSButton addTarget:self action:@selector(BSButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.ZPButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.ZPButton.backgroundColor = [UIColor whiteColor];
    [self.ZPButton setTitle:@"#自拍#" forState:UIControlStateNormal];
    [self.ZPButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.ZPButton.frame = CGRectMake(self.view.frame.size.width / 2, 0, self.view.frame.size.width / 2, 43);
    [self.ViewEight addSubview:self.ZPButton];
    [self.ZPButton addTarget:self action:@selector(ZPButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.ViewNine = [[UIView alloc] initWithFrame:CGRectMake(0, 259, self.view.frame.size.width, 1)];
    self.ViewNine.backgroundColor = DSRGBA(189, 189, 189, 1);
    [self.bigView addSubview:self.ViewNine];
    
    self.ViewTen = [[BaseUIView alloc] initWithFrame:CGRectMake(0, 260, self.view.frame.size.width, 10)];
//    self.ViewTen.backgroundColor = DSRGBA(233, 233, 233, 1);
    [self.bigView addSubview:self.ViewTen];
    // 将大View 加给TableView的头视图
    self.myTableView.tableHeaderView = self.bigView;
}
// 夜间模式按钮点击方法
-(void)NightButtonAction:(UIBarButtonItem *)item{
    DSLog(@"点击进入夜间模式");
    if ([self.dk_manager.themeVersion isEqualToString:DKThemeVersionNight]) {
        NSLog(@"白天");
        self.navigationItem.rightBarButtonItems[1].image = [[UIImage imageNamed:@"mine-moon-icon"] imageWithRenderingMode:1];
        [self.dk_manager dawnComing];
    } else {
        NSLog(@"晚上");
        self.navigationItem.rightBarButtonItems[1].image = [[UIImage imageNamed:@"mine-moon-icon-click"] imageWithRenderingMode:1];
        
        [self.dk_manager nightFalling];
    }
    
}
// 设置按钮点击方法
-(void)GearButtonAction:(UIBarButtonItem *)item{
    DSLog(@"点击进入设置");
    SZViewController *SZVC = [[SZViewController alloc] init];
    [self.navigationController pushViewController:SZVC animated:YES];
    
}
// 我的积分按钮点击方法
-(void)integralAction:(UIBarButtonItem *)item{
    DSLog(@"点击进入我的积分");
}
// 用户框按钮
-(void)UserButtonAction:(UIButton *)button{
    DSLog(@"用户区域按钮点击方法");
}
// 帖子按钮点击方法
-(void)TZButtonAction:(UIButton *)button{
    DSLog(@"帖子按钮点击方法");

}
// 关注按钮点击方法
-(void)GZzButtonAction:(UIButton *)button{
    DSLog(@"关注按钮点击方法");
}
// 粉丝按钮点击方法
-(void)FSButtonAction:(UIButton *)button{
    DSLog(@"粉丝按钮点击方法");
}
// 消息中心按钮点击方法
-(void)XXButtonAction:(UIButton *)button{
    DSLog(@"消息按钮点击方法");
}
// 我的身份按钮点击方法
-(void)MyButtonAction:(UIButton *)button{
    DSLog(@"我的身份按钮点击方法");
}
// 百思红人按钮点击方法
-(void)BSButtonAction:(UIButton *)button{
    DSLog(@"百思红人按钮点击方法");
    RedPeopleViewController *RedVC = [[RedPeopleViewController alloc] init];
    [self.navigationController pushViewController:RedVC animated:YES];
}
// 自拍按钮点击方法
-(void)ZPButtonAction:(UIButton *)button{
    DSLog(@"自拍按钮点击方法");
    TakeViewController *TakeVC = [TakeViewController new];
    [self.navigationController pushViewController:TakeVC animated:YES];
}
// 未登陆状态下的页面布局
-(void)DSBJ0{
    self.bigView = [[UIView alloc] init];
    self.bigView.backgroundColor = [UIColor whiteColor];
    self.bigView.frame = CGRectMake(0, 0, self.view.frame.size.width, 178);
    [self.view addSubview:self.bigView];
    
    self.ViewOne = [[BaseUIView alloc] init];
//    self.ViewOne.backgroundColor = DSRGBA(233, 233, 233, 1);
    self.ViewOne.frame = CGRectMake(0, 0, self.view.frame.size.width, 10);
    [self.bigView addSubview:self.ViewOne];
    
    self.ViewTwo = [[UIView alloc] init];
    self.ViewTwo.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewTwo.frame = CGRectMake(0, 10, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewTwo];
    // 登录按钮 上面有未显示的用户头像
    self.LandingButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.LandingButton.backgroundColor = [UIColor whiteColor];
    self.LandingButton.frame = CGRectMake(0, 11, self.view.frame.size.width, 40);
    [self.bigView addSubview:self.LandingButton];
    [self.LandingButton addTarget:self action:@selector(LandingButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *youImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"you"]];
    youImageV.frame = CGRectMake(380, 10, 20, 20);
    [self.LandingButton addSubview:youImageV];
    
    self.UserLabel = [[UILabel alloc] init];
    self.UserLabel.backgroundColor = [UIColor clearColor];
    self.UserLabel.text = @"登录/注册";
    self.UserLabel.frame = CGRectMake(60, 10, 100, 20);
    [self.LandingButton addSubview:self.UserLabel];
    
    UIImageView *wdlImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"defaultUserIcon"]];
    wdlImageV.frame = CGRectMake(10, 5, 30, 30);
    wdlImageV.layer.masksToBounds = YES;
    wdlImageV.layer.cornerRadius = 15;
    [self.LandingButton addSubview:wdlImageV];
    
    self.ViewThree = [[UIView alloc] init];
    self.ViewThree.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewThree.frame = CGRectMake(0, 51, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewThree];
    
    self.ViewFive = [[BaseUIView alloc] init];
//    self.ViewFive.backgroundColor = DSRGBA(233, 233, 233, 1);
    self.ViewFive.frame = CGRectMake(0, 52, self.view.frame.size.width, 10);
    [self.bigView addSubview:self.ViewFive];
    
    self.ViewSix = [[BaseUIView alloc] init];
    self.ViewSix.backgroundColor = DSRGBA(189, 189, 189, 1);
    self.ViewSix.frame = CGRectMake(0, 62, self.view.frame.size.width, 1);
    [self.bigView addSubview:self.ViewSix];
    // 我的身份
    self.myButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.myButton.backgroundColor = [UIColor whiteColor];
    self.myButton.frame = CGRectMake(0, 63, self.view.frame.size.width, 50);
    [self.bigView addSubview:self.myButton];
    [self.myButton addTarget:self action:@selector(MyButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    UIImageView *SFImageV = [[UIImageView alloc] init];
    SFImageV.image = [UIImage imageNamed:@"shenfen.jpg"];
    SFImageV.frame = CGRectMake(15, 15, 20, 20);
    [self.myButton addSubview:SFImageV];
    
    UILabel *SFLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 15, 100, 20)];
    SFLabel.text = @"我的身份";
    SFLabel.font = [UIFont systemFontOfSize:18];
    [self.myButton addSubview:SFLabel];
    
    UIImageView *you2ImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"you"]];
    you2ImageV.frame = CGRectMake(380, 15, 20, 20);
    [self.myButton addSubview:you2ImageV];
    
    UIImageView *ZSImageV = [[UIImageView alloc] init];
    ZSImageV.backgroundColor = DSRGBA(189, 189, 189, 1);
    ZSImageV.frame = CGRectMake(0, 113, self.view.frame.size.width, 1);
    [self.bigView addSubview:ZSImageV];
    
    self.ViewSix = [[BaseUIView alloc] initWithFrame:CGRectMake(0, 114, self.view.frame.size.width, 10)];
//    self.ViewSix.backgroundColor = DSRGBA(233, 233, 233, 1);
    [self.bigView addSubview:self.ViewSix];
    
    self.ViewSeven = [[UIView alloc] initWithFrame:CGRectMake(0, 124, self.view.frame.size.width, 1)];
    self.ViewSeven.backgroundColor = DSRGBA(189, 189, 189, 1);
    [self.bigView addSubview:self.ViewSeven];
    // 此View上面有百思红人  与 自拍两个按钮
    self.ViewEight = [[UIView alloc] initWithFrame:CGRectMake(0, 125, self.view.frame.size.width, 43)];
    self.ViewEight.backgroundColor = [UIColor lightGrayColor];
    [self.bigView addSubview:self.ViewEight];
    
    self.BSButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.BSButton.backgroundColor = [UIColor whiteColor];
    [self.BSButton setTitle:@"#百思红人#" forState:UIControlStateNormal];
    [self.BSButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.BSButton.frame = CGRectMake(0, 0, self.view.frame.size.width / 2 - 1, 43);
    [self.ViewEight addSubview:self.BSButton];
    [self.BSButton addTarget:self action:@selector(BSButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.ZPButton = [BaseButton buttonWithType:UIButtonTypeCustom];
//    self.ZPButton.backgroundColor = [UIColor whiteColor];
    [self.ZPButton setTitle:@"#自拍#" forState:UIControlStateNormal];
    [self.ZPButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.ZPButton.frame = CGRectMake(self.view.frame.size.width / 2, 0, self.view.frame.size.width / 2, 43);
    [self.ViewEight addSubview:self.ZPButton];
    [self.ZPButton addTarget:self action:@selector(ZPButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.ViewNine = [[UIView alloc] initWithFrame:CGRectMake(0, 167, self.view.frame.size.width, 1)];
    self.ViewNine.backgroundColor = DSRGBA(189, 189, 189, 1);
    [self.bigView addSubview:self.ViewNine];
    
    self.ViewTen = [[BaseUIView alloc] initWithFrame:CGRectMake(0, 168, self.view.frame.size.width, 10)];
//    self.ViewTen.backgroundColor = DSRGBA(233, 233, 233, 1);
    [self.bigView addSubview:self.ViewTen];
    // 将大View 加给TableView的头视图
    self.myTableView.tableHeaderView = self.bigView;
}
// 登陆按钮的点击方法
-(void)LandingButtonAction:(UIButton *)button{
    DSLog(@"登录/注册按钮");
    LandingViewController *landVC = [[LandingViewController alloc] init];
    [self presentViewController:landVC animated:YES completion:^{
        
        
    }];


}



@end
